package com.opennews.openplatform.productservice.controller

import org.springframework.beans.factory.annotation.Value
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("/product")
class ProductController {
    @Value("\${resource.upload.rootFilePath}")
    private lateinit var rootFilePath: String

    @Value("\${resource.apiKey}")
    private lateinit var apiKey: String

    @Value("\${spring.datasource.username}")
    private lateinit var username: String

    @GetMapping("/")
    fun index(): ResponseEntity<Map<String, String>> = ResponseEntity.ok(mapOf(
        "rootFilePath" to rootFilePath,
        "apiKey" to apiKey,
        "username" to username,
    ))
}